home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / OrganicIconFactory.java < prev    next >
Text File  |  1998-06-30  |  42KB  |  1,288 lines

  1. /*
  2.  * @(#)OrganicIconFactory.java    1.7 98/02/02
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.plaf.organic;
  22.  
  23. import com.sun.java.swing.*;
  24. import com.sun.java.swing.plaf.UIResource;
  25. import java.awt.*;
  26. import java.io.Serializable;
  27.  
  28. /**
  29.  * Factory object that can vend Icons appropriate for the organic.
  30.  * These are used extensively in OrganicLookAndFeel via the defaults mechanism.
  31.  * While other Look and Feels use GIFs for some of these, doing this work in code
  32.  * facilitates things when switching to other Themes.
  33.  * <p>
  34.  * Warning: serialized objects of this class will not be compatible with
  35.  * future swing releases.  The current serialization support is appropriate
  36.  * for short term storage or RMI between Swing1.0 applications.  It will
  37.  * not be possible to load serialized Swing1.0 objects with future releases
  38.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  39.  * baseline for the serialized form of Swing objects.
  40.  *
  41.  * @version 1.7 02/02/98
  42.  * @author Michael C. Albers
  43.  */
  44. public class OrganicIconFactory implements Serializable {
  45.     private static Icon frame_closeIcon;
  46.     private static Icon frame_iconifyIcon;
  47.     private static Icon frame_maxIcon;
  48.     private static Icon frame_minIcon;
  49.     private static Icon frame_resizeIcon;
  50.     private static Icon checkBoxIcon;
  51.     private static Icon radioButtonIcon;
  52.     private static Icon checkBoxMenuItemIcon;
  53.     private static Icon radioButtonMenuItemIcon;
  54.     private static Icon menuItemCheckIcon;
  55.     private static Icon menuItemArrowIcon;
  56.     private static Icon menuArrowIcon;
  57.     private static Icon treeNodeClosedIcon;
  58.     private static Icon treeNodeOpenIcon;
  59.     private static Icon treeNodeLeafIcon;
  60.     private static Icon treeComputerIcon;
  61.     private static Icon treeHardDriveIcon;
  62.     private static Icon treeFloppyDriveIcon;
  63.     private static Icon fileChooserNewFolderIcon;
  64.     private static Icon fileChooserUpFolderIcon;
  65.     private static Icon fileChooserHomeFolderIcon;
  66.     private static Icon fileChooserDetailsViewIcon;
  67.     private static Icon fileChooserListViewIcon;
  68.  
  69.     public static Icon getFileChooserListViewIcon() {
  70.     if (fileChooserListViewIcon == null) {
  71.         fileChooserListViewIcon = new FileChooserListViewIcon();
  72.     }
  73.     return fileChooserListViewIcon;
  74.     }
  75.  
  76.     public static Icon getFileChooserDetailsViewIcon() {
  77.     if (fileChooserDetailsViewIcon == null) {
  78.         fileChooserDetailsViewIcon = new FileChooserDetailsViewIcon();
  79.     }
  80.     return fileChooserDetailsViewIcon;
  81.     }
  82.  
  83.     public static Icon getFileChooserHomeFolderIcon() {
  84.     if (fileChooserHomeFolderIcon == null) {
  85.         fileChooserHomeFolderIcon = new FileChooserHomeFolderIcon();
  86.     }
  87.     return fileChooserHomeFolderIcon;
  88.     }
  89.  
  90.     public static Icon getFileChooserUpFolderIcon() {
  91.     if (fileChooserUpFolderIcon == null) {
  92.         fileChooserUpFolderIcon = new FileChooserUpFolderIcon();
  93.     }
  94.     return fileChooserUpFolderIcon;
  95.     }
  96.  
  97.     public static Icon getFileChooserNewFolderIcon() {
  98.     if (fileChooserNewFolderIcon == null) {
  99.         fileChooserNewFolderIcon = new FileChooserNewFolderIcon();
  100.     }
  101.     return fileChooserNewFolderIcon;
  102.     }
  103.  
  104.     public static Icon getTreeNodeClosedIcon() {
  105.     if (treeNodeClosedIcon == null) {
  106.         treeNodeClosedIcon = new TreeNodeClosedIcon();
  107.     }
  108.     return treeNodeClosedIcon;
  109.     }
  110.  
  111.     public static Icon getTreeNodeOpenIcon() {
  112.     if (treeNodeOpenIcon == null) {
  113.         treeNodeOpenIcon = new TreeNodeOpenIcon();
  114.     }
  115.     return treeNodeOpenIcon;
  116.     }
  117.  
  118.     public static Icon getTreeNodeLeafIcon() {
  119.     if (treeNodeLeafIcon == null) {
  120.         treeNodeLeafIcon = new TreeNodeLeafIcon();
  121.     }
  122.     return treeNodeLeafIcon;
  123.     }
  124.  
  125.     public static Icon getTreeComputerIcon() {
  126.     if (treeComputerIcon == null) {
  127.         treeComputerIcon = new TreeComputerIcon();
  128.     }
  129.     return treeComputerIcon;
  130.     }
  131.  
  132.     public static Icon getTreeHardDriveIcon() {
  133.     if (treeHardDriveIcon == null) {
  134.         treeHardDriveIcon = new TreeHardDriveIcon();
  135.     }
  136.     return treeHardDriveIcon;
  137.     }
  138.  
  139.     public static Icon getTreeFloppyDriveIcon() {
  140.     if (treeFloppyDriveIcon == null) {
  141.         treeFloppyDriveIcon = new TreeFloppyDriveIcon();
  142.     }
  143.     return treeFloppyDriveIcon;
  144.     }
  145.  
  146.     public static Icon getMenuItemCheckIcon() {
  147.     if (menuItemCheckIcon == null) {
  148.         menuItemCheckIcon = new MenuItemCheckIcon();
  149.     }
  150.     return menuItemCheckIcon;
  151.     }
  152.  
  153.     public static Icon getMenuItemArrowIcon() {
  154.     if (menuItemArrowIcon == null) {
  155.         menuItemArrowIcon = new MenuItemArrowIcon();
  156.     }
  157.     return menuItemArrowIcon;
  158.     }
  159.  
  160.     public static Icon getMenuArrowIcon() {
  161.     if (menuArrowIcon == null) {
  162.         menuArrowIcon = new MenuArrowIcon();
  163.     }
  164.     return menuArrowIcon;
  165.     }
  166.  
  167.     public static Icon getCheckBoxIcon() {
  168.     if (checkBoxIcon == null) {
  169.         checkBoxIcon = new CheckBoxIcon();
  170.     }
  171.     return checkBoxIcon;
  172.     }
  173.  
  174.     public static Icon getRadioButtonIcon() {
  175.     if (radioButtonIcon == null) {
  176.         radioButtonIcon = new RadioButtonIcon();
  177.     }
  178.     return radioButtonIcon;
  179.     }
  180.   
  181.     public static Icon getCheckBoxMenuItemIcon() {
  182.     if (checkBoxMenuItemIcon == null) {
  183.         checkBoxMenuItemIcon = new CheckBoxMenuItemIcon();
  184.     }
  185.     return checkBoxMenuItemIcon;
  186.     }
  187.  
  188.     public static Icon getRadioButtonMenuItemIcon() {
  189.     if (radioButtonMenuItemIcon == null) {
  190.         radioButtonMenuItemIcon = new RadioButtonMenuItemIcon();
  191.     }
  192.     return radioButtonMenuItemIcon;
  193.     }
  194.   
  195.   public static Icon createFrameCloseIcon() {
  196.     if(frame_closeIcon == null)
  197.       frame_closeIcon = new CloseIcon();
  198.     return frame_closeIcon;
  199.   }
  200.   
  201.   public static Icon createFrameIconifyIcon() {
  202.     if(frame_iconifyIcon == null)
  203.       frame_iconifyIcon = new IconifyIcon();
  204.     return frame_iconifyIcon;
  205.   }
  206.   
  207.   public static Icon createFrameMaximizeIcon() {
  208.     if(frame_maxIcon == null)
  209.       frame_maxIcon = new MaximizeIcon();
  210.     return frame_maxIcon;
  211.   }
  212.   
  213.   public static Icon createFrameMinimizeIcon() {
  214.     if(frame_minIcon == null)
  215.       frame_minIcon = new MinimizeIcon();
  216.     return frame_minIcon;
  217.   }
  218.   
  219.   public static Icon createFrameResizeIcon() {
  220.     if(frame_resizeIcon == null)
  221.       frame_resizeIcon = new ResizeIcon();
  222.     return frame_resizeIcon;
  223.   }
  224.   
  225.  
  226.   // Draw the Swirlly
  227.   private static class CloseIcon implements Icon, Serializable {
  228.     int height = 15;
  229.     int width = 18;
  230.     public void paintIcon(Component c, Graphics g, int x, int y) {
  231.       // Do main drawing color first
  232.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  233.  
  234.       g.translate( x+4, y+3 );
  235.  
  236.       g.drawLine(3,3, 3,4);
  237.       g.drawLine(4,5, 5,5);
  238.       g.drawLine(6,4, 6,2);
  239.       g.drawLine(5,1, 5,1);
  240.       g.drawLine(4,0, 2,0);
  241.       g.drawLine(1,1, 1,1);
  242.       g.drawLine(0,2, 0,5);
  243.       g.drawLine(1,7, 1,7);
  244.       g.drawLine(3,8, 6,8);
  245.       g.drawLine(8,7, 8,7);
  246.       g.drawLine(9,5, 9,2);
  247.  
  248.       // Do drawing with accent color
  249.       g.setColor(OrganicLookAndFeel.getControl1());
  250.       g.drawLine(6,1, 6,1);
  251.       g.drawLine(5,0, 5,0);
  252.       g.drawLine(1,0, 1,0);
  253.       g.drawLine(0,1, 0,1);
  254.       g.drawLine(0,6, 1,6);
  255.       g.drawLine(2,7, 2,8);
  256.       g.drawLine(7,8, 7,7);
  257.       g.drawLine(8,6, 9,6);
  258.       g.drawLine(9,1, 8,1);
  259.  
  260.       g.translate( -(x+4), -(x+3) );
  261.     }
  262.     public int getIconWidth() { return width; }
  263.     public int getIconHeight() { return height; }
  264.   };
  265.   
  266.   private static class IconifyIcon implements Icon, Serializable {
  267.     int height = 15;
  268.     int width = 18;
  269.     public void paintIcon(Component c, Graphics g, int x, int y) {
  270.       // Do main drawing color first
  271.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  272.  
  273.       g.translate( x+4, y+4 );
  274.  
  275.       g.drawLine(0,1, 1,2);
  276.       g.drawLine(5,0, 5,1);
  277.       g.drawLine(9,2, 10,1);
  278.       g.fillRect(3,6, 5, 2 );
  279.  
  280.       // Do drawing with accent color
  281.       g.setColor(OrganicLookAndFeel.getControl1());
  282.       g.drawLine(0,2, 1,1);
  283.       g.drawLine(2,3, 2,3);
  284.       g.drawLine(5,2, 5,2);
  285.       g.drawLine(9,1, 10,2);
  286.       g.drawLine(8,3, 8,3);
  287.  
  288.       g.translate( -(x+4), -(y+4) );
  289.     }
  290.     public int getIconWidth() { return width; }
  291.     public int getIconHeight() { return height; }
  292.   };
  293.   
  294.   private static class MaximizeIcon implements Icon, Serializable {
  295.     int height = 15;
  296.     int width = 18;
  297.     public void paintIcon(Component c, Graphics g, int x, int y) {
  298.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  299.  
  300.       g.translate( x+4, y+4 );
  301.  
  302.       g.drawRect(1,0, 8,8);
  303.       g.drawLine(2,1, 8,1);
  304.  
  305.       g.translate( -(x+4), -(y+4) );
  306.     }
  307.     public int getIconWidth() { return width; }
  308.     public int getIconHeight() { return height; }
  309.   };
  310.   
  311.   private static class MinimizeIcon implements Icon, Serializable {
  312.     int height = 16;
  313.     int width = 14;
  314.     public void paintIcon(Component c, Graphics g, int x, int y) {
  315.       g.setColor(OrganicLookAndFeel.getControl1());
  316.  
  317.       // Draw the little window
  318.       g.translate( x+1, y+6 );
  319.  
  320.       g.drawRect(1,0, 8,7);
  321.       g.drawLine(2,1, 8,1);
  322.  
  323.       g.translate( -(x+1), -(y+6) );
  324.  
  325.       // Draw the action
  326.       g.translate( x+2, y+1 );
  327.  
  328.       g.setColor( OrganicLookAndFeel.getLightAccent1() );
  329.       g.drawLine( 6,1, 6,2 );
  330.       g.drawLine( 10,3, 11,2 );
  331.       g.drawLine( 11,7, 12,7 );
  332.  
  333.       g.setColor( OrganicLookAndFeel.getControl1() );
  334.       g.drawLine( 6,3, 6,3 );
  335.       g.drawLine( 10,2, 11,3 );
  336.       g.drawLine( 9,4, 9,4 );
  337.       g.drawLine( 10,7, 10,7 );
  338.  
  339.       g.translate( -(x+2), -(y+1) );
  340.     }
  341.     public int getIconWidth() { return width; }
  342.     public int getIconHeight() { return height; }
  343.   };
  344.   
  345.   private static class ResizeIcon implements Icon, Serializable {
  346.     public void paintIcon(Component c, Graphics g, int x, int y) {
  347.       g.setColor(OrganicLookAndFeel.getLightAccent1() );
  348.       g.drawLine(0, 11, 11, 0);
  349.       g.drawLine(4, 11, 11, 4);
  350.       g.drawLine(8, 11, 11, 8);
  351.       
  352.       g.setColor(OrganicLookAndFeel.getWindowTitleBackground() );
  353.       g.drawLine(1, 11, 11, 1);
  354.       g.drawLine(2, 11, 11, 2);
  355.       g.drawLine(5, 11, 11, 5);
  356.       g.drawLine(6, 11, 11, 6);
  357.       g.drawLine(9, 11, 11, 9);
  358.       g.drawLine(10, 11, 11, 10);
  359.     }
  360.     public int getIconWidth() { return 13; }
  361.     public int getIconHeight() { return 13; }
  362.   };
  363.   
  364.     private static class CheckBoxIcon implements Icon, UIResource, Serializable
  365.     {
  366.     public void paintIcon( Component c, Graphics g, int x, int y )
  367.     {
  368.  
  369.     }
  370.  
  371.     public int getIconWidth() { return 0; }
  372.  
  373.     public int getIconHeight() { return 0; }
  374.  
  375.     }  // End class CheckBoxIcon
  376.  
  377.     private static class CheckBoxMenuItemIcon implements Icon, UIResource, Serializable
  378.     {
  379.     public void paintIcon( Component c, Graphics g, int x, int y )
  380.     {
  381.         AbstractButton b = (AbstractButton) c;
  382.         ButtonModel model = b.getModel();
  383.         boolean isSelected = model.isSelected();
  384.         boolean isPressed = model.isPressed();
  385.         boolean isArmed = model.isArmed();
  386.         
  387.         Color oldColor = g.getColor();
  388.         g.translate( 5, 0 );
  389.  
  390.         g.setColor( OrganicLookAndFeel.getControl2()  );
  391.         g.drawRect( x, y, 8, 8 );
  392.  
  393.         if ( isPressed || isArmed )
  394.         {
  395.         g.setColor( OrganicLookAndFeel.getMenuBackground()  );
  396.             g.fillRect( x + 1, y + 1, 7, 7 );
  397.         }
  398.  
  399.         if ( isSelected )
  400.         {
  401.             g.translate( 2, 0 );
  402.         
  403.         g.setColor( OrganicLookAndFeel.getMenuForeground()  );
  404.         g.drawLine( x, y + 2, x, y + 6 );
  405.         g.drawLine( x + 1, y + 2, x + 1, y + 6 );
  406.         g.drawLine( x + 2, y + 4, x + 6, y );
  407.         g.drawLine( x + 2, y + 5, x + 7, y );
  408.         
  409.         g.translate( -2, 0 );
  410.         }
  411.  
  412.         g.translate( -5, 0 );
  413.         g.setColor( oldColor );
  414.     }
  415.  
  416.     public int getIconWidth() { return 12; }
  417.  
  418.     public int getIconHeight() { return 9; }
  419.  
  420.     }  // End class CheckBoxMenuItemIcon
  421.  
  422.     private static class RadioButtonIcon implements Icon, UIResource, Serializable
  423.     {
  424.         public void paintIcon(Component c, Graphics g, int x, int y) {
  425.             JRadioButton rb = (JRadioButton)c;
  426.         ButtonModel model = rb.getModel();
  427.  
  428.             Color background = UIManager.getColor("RadioButton.background");
  429.             Color shadow = UIManager.getColor("RadioButton.shadow");
  430.             Color darkShadow = UIManager.getColor("RadioButton.darkShadow");
  431.             Color highlight = UIManager.getColor("RadioButton.highlight");
  432.             Color lightHighlight = UIManager.getColor("RadioButton.lightHighlight");
  433.         Color dot = UIManager.getColor("RadioButton.dot");
  434.  
  435.         // Set up the colors for each area
  436.         Color outerLeftColor = lightHighlight;
  437.         if ( !model.isEnabled() ) {
  438.             outerLeftColor = shadow;
  439.         }
  440.         else if ( model.isSelected() || (model.isPressed() && model.isArmed() ) ) {
  441.             outerLeftColor = darkShadow;
  442.         }
  443.         
  444.         Color outerRightColor = shadow;
  445.         if ( !model.isEnabled() ) {
  446.             outerRightColor = shadow;
  447.         }
  448.         else if ( model.isSelected() || (model.isPressed() && model.isArmed()) ) {
  449.             outerRightColor = lightHighlight;
  450.         }
  451.         
  452.         // Set up the colors for each area
  453.         Color leftColor = lightHighlight;
  454.         Color rightColor = shadow;
  455.         Color dotColor = dot;
  456.         Color interiorColor = background;
  457.         boolean drawDot = model.isSelected();
  458.         boolean drawCorners = !model.isEnabled();
  459.  
  460.         if ( !model.isEnabled() ) {
  461.             interiorColor = background;
  462.             leftColor = shadow;
  463.             rightColor =shadow;
  464.             dotColor = darkShadow;
  465.         }
  466.         else if ( model.isPressed() && model.isArmed() ) {
  467.             if ( model.isSelected() ) {
  468.                 interiorColor = background;
  469.             }
  470.             else {
  471.                 interiorColor = shadow;
  472.             }
  473.             leftColor = darkShadow;
  474.             rightColor = lightHighlight;            
  475.         }
  476.         else if ( model.isSelected() ) {
  477.             interiorColor = background;
  478.             leftColor = darkShadow;
  479.             rightColor = lightHighlight;            
  480.         }
  481.         else {
  482.             interiorColor = background;
  483.             leftColor = lightHighlight;
  484.             rightColor = shadow;
  485.         }
  486.  
  487.         // fill interior
  488.         g.setColor( interiorColor );
  489.         g.fillRect(x+2, y+2, 9, 9);
  490.         g.drawLine(x+4, y+1, x+9, y+1);
  491.         g.drawLine(x+11, y+3, x+11, y+8);
  492.         g.drawLine(x+8, y+11, x+3, y+11);
  493.         g.drawLine(x+1, y+9, x+1, y+4);
  494.         
  495.         // outter left arc
  496.         g.setColor( leftColor );
  497.         g.drawLine(x+1, y+10, x+1, y+10);
  498.         g.drawLine(x+0, y+8, x+0, y+4);
  499.         g.drawLine(x+1, y+3, x+1, y+2);
  500.               g.drawLine(x+2, y+1, x+3, y+1);
  501.               g.drawLine(x+4, y+0, x+8, y+0);
  502.               g.drawLine(x+10, y+1, x+10, y+1);
  503.  
  504.         // outer right arc
  505.         g.setColor( rightColor );
  506.         g.drawLine(x+11, y+2, x+11, y+2);
  507.         g.drawLine(x+12, y+4, x+12, y+8);
  508.         g.drawLine(x+11, y+9, x+11, y+10);
  509.         g.drawLine(x+10, y+11, x+9, y+11);
  510.         g.drawLine(x+8, y+12, x+4, y+12);
  511.         g.drawLine(x+2, y+11, x+2, y+11);
  512.         
  513.         // corners
  514.         if ( drawCorners ) {
  515.             g.drawLine( x+1, y+9, x+1, y+9 );
  516.             g.drawLine( x+9, y+1, x+9, y+1 );            
  517.             g.drawLine( x+11, y+3, x+11, y+3 );
  518.             g.drawLine( x+3, y+11, x+3, y+11 );
  519.         }
  520.  
  521.         // selected dot
  522.         if ( drawDot ) {
  523.             g.setColor( dotColor );
  524.             g.fillRect(x+4, y+4, 5, 5);
  525.             g.fillRect(x+5, y+3, 3, 7);
  526.             g.fillRect(x+3, y+5, 7, 3);
  527.             g.setColor(darkShadow);
  528.             g.drawLine(x+3, y+4, x+4, y+3);
  529.             g.drawLine(x+8, y+3, x+9, y+4);
  530.             g.drawLine(x+9, y+8, x+8, y+9);
  531.             g.drawLine(x+4, y+9, x+3, y+8);
  532.         }
  533.  
  534.             // Draw the khaki circle around it
  535.             g.translate( x, y );
  536.             g.setColor( background );
  537.             g.drawLine( -1, 8, -1, 4 );
  538.         g.drawLine( 0, 3, 0, 2 );
  539.         g.drawLine( 1, 1, 1, 1 );
  540.         g.drawLine( 2, 0, 3, 0 );
  541.         g.drawLine( 4, -1, 8, -1 );
  542.         g.drawLine( 9, 0, 10, 0 );
  543.         g.drawLine( 11, 1, 11, 1 );
  544.         g.drawLine( 12, 2, 12, 3 );
  545.         g.drawLine( 13, 4, 13, 8 );
  546.         g.drawLine( 12, 9, 12, 10 );
  547.         g.drawLine( 11, 11, 11, 11 );
  548.         g.drawLine( 9, 12, 10, 12 );
  549.         g.drawLine( 4, 13, 8, 13 );
  550.         g.drawLine( 2, 12, 3, 12 );
  551.         g.drawLine( 1, 11, 1, 11 );
  552.         g.drawLine( 0, 9, 0, 10 );
  553.         g.translate( -x, -y );
  554.         }
  555.  
  556.         public int getIconWidth() {
  557.         return 13;
  558.         }
  559.         
  560.         public int getIconHeight() {
  561.         return 13;
  562.         }
  563.  
  564.     }  // End class RadioButtonIcon
  565.  
  566.     private static class RadioButtonMenuItemIcon implements Icon, UIResource, Serializable
  567.     {
  568.     public void paintIcon( Component c, Graphics g, int x, int y )
  569.     {
  570.         AbstractButton b = (AbstractButton) c;
  571.         ButtonModel model = b.getModel();
  572.         boolean isSelected = model.isSelected();
  573.         boolean isPressed = model.isPressed();
  574.         boolean isArmed = model.isArmed();
  575.  
  576.         Color oldColor = g.getColor();
  577.         g.translate( 6, 0 );
  578.         g.setColor( OrganicLookAndFeel.getControl2()  );
  579.  
  580.         g.drawLine( x + 2, y, x + 5, y );
  581.         g.drawLine( x + 1, y + 1, x + 1, y + 1 );
  582.         g.drawLine( x + 6, y + 1, x + 6, y + 1 );
  583.         g.drawLine( x, y + 2, x, y + 5 );
  584.         g.drawLine( x + 7, y + 2, x + 7, y + 5 );
  585.         g.drawLine( x + 1, y + 6, x + 1, y + 6 );
  586.         g.drawLine( x + 6, y + 6, x + 6, y + 6 );
  587.         g.drawLine( x + 2, y + 7, x + 5, y + 7 );
  588.         
  589.         if ( isSelected )
  590.         {
  591.         g.setColor( OrganicLookAndFeel.getControl2() );
  592.  
  593.         g.drawLine( x + 2, y + 1, x + 5, y + 1 );
  594.         g.drawLine( x + 1, y + 2, x + 6, y + 2 );
  595.         g.drawLine( x + 1, y + 3, x + 6, y + 3 );
  596.         g.drawLine( x + 1, y + 4, x + 6, y + 4 );
  597.         g.drawLine( x + 1, y + 5, x + 6, y + 5 );
  598.         g.drawLine( x + 2, y + 6, x + 5, y + 6 );
  599.         }
  600.         else if ( isPressed || isArmed )
  601.         {
  602.         g.setColor( OrganicLookAndFeel.getMenuBackground() );
  603.  
  604.         g.drawLine( x + 2, y + 1, x + 5, y + 1 );
  605.         g.drawLine( x + 1, y + 2, x + 6, y + 2 );
  606.         g.drawLine( x + 1, y + 3, x + 6, y + 3 );
  607.         g.drawLine( x + 1, y + 4, x + 6, y + 4 );
  608.         g.drawLine( x + 1, y + 5, x + 6, y + 5 );
  609.         g.drawLine( x + 2, y + 6, x + 5, y + 6 );
  610.         }
  611.  
  612.         if ( isSelected )
  613.         {
  614.             g.translate( 2, 2 );
  615.         g.setColor( OrganicLookAndFeel.getMenuForeground() );
  616.  
  617.         g.drawLine( x + 1, y, x + 2, y );
  618.         g.drawLine( x, y + 1, x + 3, y + 1 );
  619.         g.drawLine( x, y + 2, x + 3, y + 2 );
  620.         g.drawLine( x + 1, y + 3, x + 2, y + 3 );
  621.         
  622.             g.translate( -2, -2 );
  623.         }
  624.  
  625.         g.translate( -6, 0 );
  626.         g.setColor( oldColor );
  627.     }
  628.  
  629.     public int getIconWidth() { return 12; }
  630.  
  631.     public int getIconHeight() { return 9; }
  632.  
  633.     }  // End class RadioButtonMenuItemIcon
  634.  
  635.     private static class MenuItemCheckIcon implements Icon, UIResource, Serializable{
  636.     public void paintIcon(Component c, Graphics g, int x, int y) {
  637.         /* For debugging:
  638.            Color oldColor = g.getColor();
  639.         g.setColor(Color.orange);
  640.         g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true);
  641.         g.setColor(oldColor);
  642.         */
  643.     }
  644.     public int getIconWidth() { return 12; }
  645.     public int getIconHeight() { return 9; }
  646.  
  647.     } // End class MenuItemCheckIcon
  648.  
  649.     private static class MenuItemArrowIcon implements Icon, UIResource, Serializable {
  650.     public void paintIcon(Component c, Graphics g, int x, int y) {
  651.         /* For debugging:
  652.         Color oldColor = g.getColor();
  653.         g.setColor(Color.green);
  654.         g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true);
  655.         g.setColor(oldColor);
  656.         */
  657.     }
  658.     public int getIconWidth() { return 5; }
  659.     public int getIconHeight() { return 7; }
  660.  
  661.     } // End class MenuItemArrowIcon
  662.  
  663.     private static class MenuArrowIcon implements Icon, UIResource, Serializable
  664.     {
  665.     public void paintIcon(Component c, Graphics g, int x, int y)
  666.     {
  667.         Color oldColor = g.getColor();
  668.         g.translate( 0, 0 );
  669.  
  670.         g.setColor( OrganicLookAndFeel.getMenuForeground() );
  671.         g.drawLine( x, y, x + 3, y + 3 );
  672.         g.drawLine( x + 1, y, x + 4, y + 3 );
  673.         g.drawLine( x, y + 6, x + 3, y + 3 );
  674.         g.drawLine( x + 1, y + 6, x + 4, y + 3 );
  675.  
  676.         g.setColor( OrganicLookAndFeel.getControl3() );
  677.         g.drawLine( x, y + 1, x + 2, y + 3 );
  678.         g.drawLine( x, y + 5, x + 2, y + 3 );
  679.  
  680.         g.translate( 0, 0 );
  681.         g.setColor( oldColor );
  682.     }
  683.  
  684.     public int getIconWidth() { return 5; }
  685.  
  686.     public int getIconHeight() { return 7; }
  687.     } // End class MenuArrowIcon
  688.  
  689.  
  690.   // Draw the icons for a closed tree node
  691.   private static class TreeNodeClosedIcon implements Icon, UIResource, Serializable {
  692.     public void paintIcon(Component c, Graphics g, int x, int y) {
  693.       g.translate(x,y);
  694.       // Draw Tab = draw LightAccent4 (Dark Orange) 
  695.       g.setColor(OrganicLookAndFeel.getLightAccent4());
  696.       g.drawLine(2,2, 5,2);
  697.       g.drawLine(2,3, 5,3);
  698.  
  699.       // Draw highlights on top left, top right, bottom left
  700.       //  Control2 (medium Khaki)
  701.       g.setColor(OrganicLookAndFeel.getControl2());
  702.       g.drawLine(1,3, 1,3);   // top left
  703.       g.drawLine(13,3, 13,3); // top right
  704.       g.drawLine(1,13, 1,13); // bottom left
  705.  
  706.       // Draw edges in Control3 (MediumDark Khaki)
  707.       g.setColor(OrganicLookAndFeel.getControl3());
  708.       g.drawLine(6,3, 12,3); // top line
  709.       g.drawLine(1,4, 13,4); // one line down
  710.       g.drawLine(1,5, 1,12); // down the left side
  711.       g.drawLine(14,6, 14,13); // down the right side
  712.       g.drawLine(2,13, 13,13); // bottom line
  713.  
  714.       // Draw internal highlights (Cream)
  715.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  716.       g.drawLine(3,6, 13,6);  // across the top
  717.       g.drawLine(3,7, 3,12);  // down the left
  718.  
  719.       // Draw one highlight and the body of the folder (light Khaki)
  720.       g.setColor(OrganicLookAndFeel.getControl1());
  721.       g.drawLine(14,5, 14,5); // single highlight - upper right
  722.       g.fillRect(3,6, 11, 7); // body of folder
  723.  
  724.       g.translate(-x,-y);
  725.     }
  726.     public int getIconWidth() { return 16; }
  727.     public int getIconHeight() { return 16; }
  728.   };
  729.  
  730.  
  731.   // Draw the icons for an open tree node
  732.   private static class TreeNodeOpenIcon implements Icon, UIResource, Serializable {
  733.     public void paintIcon(Component c, Graphics g, int x, int y) {
  734.       g.translate(x,y);
  735.       // Draw Tab = draw LightAccent4 (Dark Orange) 
  736.       g.setColor(OrganicLookAndFeel.getLightAccent4());
  737.       g.drawLine(1,3, 4,3);
  738.       g.drawLine(1,4, 4,4);
  739.  
  740.       // Draw highlights on top left, top right, bottom left
  741.       //  Control2 (medium Khaki)
  742.       g.setColor(OrganicLookAndFeel.getControl2());
  743.       g.drawLine(0,4, 0,4);   // top left
  744.       g.drawLine(12,4, 12,4); // top right
  745.       g.drawLine(0,13, 0,13); // bottom left
  746.  
  747.       // Draw inside color for folder (MediumDark Khaki)
  748.       g.setColor(OrganicLookAndFeel.getControl3());
  749.       g.drawLine(5,4, 11,4); // top line
  750.       g.drawLine(0,5, 12,5); // one line down
  751.       g.drawLine(0,6, 3,6); 
  752.       g.fillRect(0,7, 3, 2);
  753.       g.fillRect(0,9, 2, 2);
  754.       g.drawLine(0,11, 0,11);
  755.       g.drawLine(0,12, 0,12);
  756.  
  757.       // Draw front edge of folder (light green)
  758.       g.setColor(OrganicLookAndFeel.getHighlight2());
  759.       g.drawLine(4,6, 15,6);      //////////// across the top
  760.       g.drawLine(3,7, 3,8);      // down the left
  761.       g.drawLine(2,9, 2,10);    // down the left
  762.       g.drawLine(1,11, 1,12);  // down the left
  763.  
  764.       // Draw body of the folder (dark green)
  765.       g.setColor(OrganicLookAndFeel.getHighlight4());
  766.       g.drawLine(4,7, 14,7); 
  767.       g.drawLine(4,8, 13,8); 
  768.       g.drawLine(3,9, 13,9); 
  769.       g.drawLine(3,10, 12,10); 
  770.       g.drawLine(2,11, 12,11); 
  771.       g.drawLine(2,12, 11,12);
  772.  
  773.       // Draw black bottom and right edge
  774.       g.setColor(OrganicLookAndFeel.getBlack());
  775.       g.drawLine(15,7, 15,7);   // right edge
  776.       g.drawLine(14,8, 14,9);   // right edge
  777.       g.drawLine(13,10, 13,11); // right edge
  778.       g.drawLine(12,12, 12,12); // right edge
  779.       g.drawLine(1,13, 12,13);  // bottom edge
  780.  
  781.       g.translate(-x,-y);
  782.     }
  783.     public int getIconWidth() { return 16; }
  784.     public int getIconHeight() { return 16; }
  785.   };
  786.  
  787.  
  788.   // Draw the icons for a leaf tree node
  789.   private static class TreeNodeLeafIcon implements Icon, UIResource, Serializable {
  790.     public void paintIcon(Component c, Graphics g, int x, int y) {
  791.       g.translate(x,y);
  792.       // Draw big blocks of LightAccent1 (Cream) to be the background
  793.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  794.       g.fillRect(3,2, 9, 11); // big top rect
  795.       g.drawLine(9,13, 11,13); // missed a line
  796.  
  797.       // Draw top  and left edge of document
  798.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  799.       g.drawLine(2,1, 11,1); // top
  800.       g.drawLine(2,2, 2,11); // left
  801.  
  802.       // Draw black - right edge and bottom pieces
  803.       g.setColor(OrganicLookAndFeel.getBlack());
  804.       g.drawLine(12,2, 12,14); // right edge
  805.       g.drawLine(8,14, 12,14); // bottom edge
  806.       g.drawLine(8,13, 8,13); // bottom piece
  807.       g.drawLine(7,12, 7,12); // bottom piece
  808.       g.drawLine(5,11, 6,11); // bottom piece
  809.       g.drawLine(3,12, 4,12); // bottom piece
  810.       g.drawLine(5,13, 6,13); // bottom piece
  811.  
  812.       // Draw DarkAccent4's accents
  813.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  814.       g.drawLine(12,1, 12,1); // top right pixel
  815.       g.drawLine(7,13, 7,14); // highlights on bottom area
  816.       g.drawLine(6,10, 6,10); // highlights on bottom area
  817.       g.drawLine(6,12, 6,12); // highlights on bottom area
  818.  
  819.       // Draw DarkAccent1's smattering of color about document
  820.       g.setColor(OrganicLookAndFeel.getDarkAccent1());
  821.       g.drawLine(3,7, 3,7);
  822.       g.drawLine(4,8, 4,8);
  823.       g.drawLine(6,8, 6,8);
  824.       g.drawLine(3,9, 3,9);
  825.       g.drawLine(5,9, 5,9);
  826.       g.drawLine(7,9, 7,9);
  827.       g.drawLine(9,9, 9,9);
  828.       g.drawLine(11,9, 11,9);
  829.       g.drawLine(4,10, 4,10);
  830.       g.drawLine(6,10, 6,10);
  831.       g.drawLine(8,10, 8,10);
  832.       g.drawLine(10,10, 10,10);
  833.       g.drawLine(3,11, 4,11);
  834.       g.drawLine(7,11, 7,11);
  835.       g.drawLine(9,11, 9,11);
  836.       g.drawLine(11,11, 11,11);
  837.       g.drawLine(5,12, 5,12);
  838.       g.drawLine(8,12, 8,12);
  839.       g.drawLine(10,12, 10,12);
  840.       g.drawLine(9,13, 9,13);
  841.       g.drawLine(11,13, 11,13);
  842.  
  843.       g.translate(-x,-y);
  844.     }
  845.     public int getIconWidth() { return 16; }
  846.     public int getIconHeight() { return 16; }
  847.   };
  848.  
  849.  
  850.   // Draw the computer icon used in the tree and directory pane
  851.   private static class TreeComputerIcon implements Icon, UIResource, Serializable {
  852.       Color screenColor = new Color(175,239,223);
  853.     public void paintIcon(Component c, Graphics g, int x, int y) {
  854.       g.translate(x,y);
  855.       // Draw big blocks of Control1 for monitor and CPU
  856.       g.setColor(OrganicLookAndFeel.getControl1());
  857.       g.fillRect(2,0,  12,10); // monitor
  858.       g.fillRect(0,10, 16,6); // CPU
  859.  
  860.       // Draw top and left edge of monitor and CPU
  861.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  862.       g.drawLine(2,0, 12,0); // monitor - top
  863.       g.drawLine(2,1,  2,8); // monitor - left
  864.       g.drawLine(0,10, 14,10); // CPU - top
  865.       g.drawLine(0,11,  0,14); // CPU - left
  866.  
  867.       // Draw right and bottom edge of monitor and CPU
  868.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  869.       g.drawLine(13,1, 13,9); // monitor - right
  870.       g.drawLine( 3,9, 12,9); // monitor - bottom
  871.       g.drawLine(15,11, 15,15); // CPU - right
  872.       g.drawLine(1,15,  14,15); // CPU - bottom
  873.  
  874.       // Draw floppy drives on CPU
  875.       g.setColor(OrganicLookAndFeel.getControl3());
  876.       g.drawLine( 6,12,  9,12);
  877.       g.drawLine(11,12, 14,12);
  878.  
  879.       // Draw screen portion of monitor
  880.       g.setColor(screenColor);
  881.       g.fillRect(4,2, 8,6);
  882.  
  883.       g.translate(-x,-y);
  884.     }
  885.     public int getIconWidth() { return 16; }
  886.     public int getIconHeight() { return 16; }
  887.   };
  888.  
  889.  
  890.   // Draw the hard drive icon used in the tree and directory pane
  891.   private static class TreeHardDriveIcon implements Icon, UIResource, Serializable {
  892.     public void paintIcon(Component c, Graphics g, int x, int y) {
  893.       g.translate(x,y);
  894.       // Draw big block of Control1
  895.       g.setColor(OrganicLookAndFeel.getControl1());
  896.       g.fillRect(0,8, 16,7);
  897.  
  898.       // Draw highlight on hard drive case
  899.       g.setColor(OrganicLookAndFeel.getControl2());
  900.       g.drawLine(2,12, 13,12);
  901.  
  902.       // Draw little activity lights on hard drive case
  903.       g.setColor(OrganicLookAndFeel.getHighlight1());
  904.       g.drawLine(10,10, 11,10);
  905.       g.setColor(OrganicLookAndFeel.getHighlight2());
  906.       g.drawLine(12,10, 13,10);
  907.  
  908.       // Draw the left/top highlights on hard drive
  909.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  910.       g.drawLine(0,8, 14,8); // top
  911.       g.drawLine(0,9, 0,13); // left
  912.  
  913.       // Draw the right/bottom highlights on hard drive
  914.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  915.       g.drawLine(15,9, 15,14); // right
  916.       g.drawLine(1,14, 14,14); // bottom
  917.  
  918.       g.translate(-x,-y);
  919.     }
  920.     public int getIconWidth() { return 16; }
  921.     public int getIconHeight() { return 16; }
  922.   };
  923.  
  924.  
  925.   // Draw the floppy drive icon used in the tree and directory pane
  926.   private static class TreeFloppyDriveIcon implements Icon, UIResource, Serializable {
  927.       Color screenColor = new Color(175,239,223);
  928.     public void paintIcon(Component c, Graphics g, int x, int y) {
  929.       g.translate(x,y);
  930.       // Draw Control3 for background (becomes the edge only)
  931.       g.setColor(OrganicLookAndFeel.getControl3());
  932.       g.fillRect(0,0, 16,16);
  933.  
  934.       // Draw Control1 for body of floppy
  935.       g.setColor(OrganicLookAndFeel.getControl1());
  936.       g.fillRect(1,1, 14,14);
  937.  
  938.       // Draw the label on the floppy
  939.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  940.       g.fillRect(2,1, 12,7);
  941.  
  942.       // Draw the dashes on the label
  943.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  944.       g.drawLine(2,0, 13,0);
  945.       g.drawLine(3,2, 12,2);
  946.       g.drawLine(3,4, 12,4);
  947.       g.drawLine(3,6, 12,6);
  948.  
  949.       // Draw floppy door
  950.       // open part
  951.       g.setColor(OrganicLookAndFeel.getDarkAccent2());
  952.       g.drawLine(11,10, 12,10);
  953.       g.fillRect(12,11, 2,4);
  954.       // actual door part
  955.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  956.       g.drawLine(5,10, 10,10);
  957.       g.fillRect(4,11, 8,4);
  958.       // draw hole in door
  959.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  960.       g.drawLine(6,11, 6,13);
  961.  
  962.       g.translate(-x,-y);
  963.     }
  964.     public int getIconWidth() { return 16; }
  965.     public int getIconHeight() { return 16; }
  966.   };
  967.  
  968.  
  969.   // Draw the icon for the "new folder" in the file chooser
  970.   private static class FileChooserNewFolderIcon implements Icon, UIResource, Serializable {
  971.     public void paintIcon(Component c, Graphics g, int x, int y) {
  972.       g.translate(x,y);
  973.  
  974.       // Fill body area with Control1
  975.       g.setColor(OrganicLookAndFeel.getControl1());
  976.       g.fillRect(1,4, 16,10);
  977.  
  978.       // Draw edge highlights on top and left
  979.       //  LightAccent1 (Cream)
  980.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  981.       g.drawLine(1,4, 16,4); // top - part of this gets overwritten
  982.       g.drawLine(1,5, 1,13); // left
  983.  
  984.       // Draw edges in DarkAccent3 (Darkish Purple)
  985.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  986.       g.drawLine(17,5, 17,14); // right
  987.       g.drawLine(2,14, 16,14); // bottom
  988.  
  989.       // Draw Tab = draw DarkAccent4 (Dark Purple) and DarkAccent1
  990.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  991.       g.drawLine(3,2, 6,2);
  992.       g.drawLine(2,3, 7,3);
  993.       g.setColor(OrganicLookAndFeel.getDarkAccent1());
  994.       g.drawLine(2,4, 7,4); // overwrites part of a cream line
  995.  
  996.       g.translate(-x,-y);
  997.     }
  998.     public int getIconWidth() { return 19; }
  999.     public int getIconHeight() { return 17; }
  1000.   };
  1001.  
  1002.  
  1003.   // Draw the icon for the "up folder" in the file chooser
  1004.   private static class FileChooserUpFolderIcon implements Icon, UIResource, Serializable {
  1005.     public void paintIcon(Component c, Graphics g, int x, int y) {
  1006.       g.translate(x,y);
  1007.  
  1008.       // Fill body area of both folders with Control1
  1009.       g.setColor(OrganicLookAndFeel.getControl1());
  1010.       g.fillRect(0,1, 9,6); // top folder
  1011.       g.fillRect(9,10, 9,6); // bottom folder
  1012.  
  1013.       // Draw edge highlights on top and left
  1014.       //  LightAccent1 (Cream)
  1015.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  1016.       // Top folder
  1017.       g.drawLine(0,1, 8,1); // top - part of this gets overwritten
  1018.       g.drawLine(0,2, 0,6); // left
  1019.       // Bottom folder
  1020.       g.drawLine(9,10, 16,10); // top - part of this gets overwritten
  1021.       g.drawLine(9,11, 9,15);  // left
  1022.  
  1023.       // Draw edges in DarkAccent3 (Darkish Purple)
  1024.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  1025.       // Top Folder
  1026.       g.drawLine(9,2, 9,7); // right
  1027.       g.drawLine(1,7, 8,7); // bottom
  1028.       // Bottom Folder
  1029.       g.drawLine(17,11, 17,16); // right
  1030.       g.drawLine(10,16, 17,16); // bottom
  1031.  
  1032.       // Draw Tab = draw DarkAccent4 (Dark Purple) and DarkAccent1
  1033.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  1034.       g.drawLine(1,0, 3,0);  // Top folder
  1035.       g.drawLine(10,9, 12,9); // Bottom folder
  1036.       g.setColor(OrganicLookAndFeel.getDarkAccent1());
  1037.       g.drawLine(1,1, 3,1);     // Top folder - overwrites part of a cream line
  1038.       g.drawLine(10,10, 12,10); // Bottom folder - overwrites part of a cream line
  1039.  
  1040.       // Draw Arrow in Black and Control2
  1041.       g.setColor(OrganicLookAndFeel.getBlack());
  1042.       g.drawLine(10,4, 14,4); // horiz line
  1043.       g.drawLine(11,3, 11,5);
  1044.       g.drawLine(12,2, 12,6);
  1045.       g.drawLine(15,5, 15,5); // turning point of arrow
  1046.       g.drawLine(16,6, 16,9); // vert line
  1047.       g.setColor(OrganicLookAndFeel.getControl2());
  1048.       g.drawLine(15,4, 15,4);
  1049.       g.drawLine(16,5, 16,5);
  1050.  
  1051.       // Draw tree-like connecting line between folders (in DarkAccent4)
  1052.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  1053.       g.drawLine(4,10, 4,13); // Vert line
  1054.       g.drawLine(5,13, 6,13); // Horiz line
  1055.  
  1056.       g.translate(-x,-y);
  1057.     }
  1058.     public int getIconWidth() { return 19; }
  1059.     public int getIconHeight() { return 17; }
  1060.   };
  1061.  
  1062.  
  1063.   // Draw the icon for the "home folder" in the file chooser
  1064.   private static class FileChooserHomeFolderIcon implements Icon, UIResource, Serializable {
  1065.     public void paintIcon(Component c, Graphics g, int x, int y) {
  1066.       g.translate(x,y);
  1067.  
  1068.       // Fill body area with Control1
  1069.       g.setColor(OrganicLookAndFeel.getControl1());
  1070.       // fill top arrow
  1071.       g.drawLine(9,3,  9,3);
  1072.       g.drawLine(8,4, 10,4);
  1073.       g.drawLine(7,5, 11,5);
  1074.       g.drawLine(6,6, 12,6);
  1075.       g.drawLine(5,7, 13,7);
  1076.       // fill bottom arrow
  1077.       g.drawLine(9, 9,  9, 9);
  1078.       g.drawLine(8,10, 10,10);
  1079.       g.drawLine(7,11, 11,11);
  1080.       g.drawLine(6,12, 12,12);
  1081.       g.drawLine(5,13, 13,13);
  1082.  
  1083.       // Draw edge highlight on the left diagonal in LightAccent1 (Cream)
  1084.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  1085.       // top arrow
  1086.       g.drawLine(8,3, 8,3);
  1087.       g.drawLine(7,4, 7,4);
  1088.       g.drawLine(6,5, 6,5);
  1089.       g.drawLine(5,6, 5,6);
  1090.       g.drawLine(4,7, 4,7);
  1091.       // bottom arrow
  1092.       g.drawLine(8,9,  8,9);
  1093.       g.drawLine(7,10, 7,10);
  1094.       g.drawLine(6,11, 6,11);
  1095.       g.drawLine(5,12, 5,12);
  1096.       g.drawLine(4,13, 4,13);
  1097.  
  1098.       // Draw edge highlight on the right diagonal in DarkAccent3
  1099.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  1100.       // top arrow
  1101.       g.drawLine(10,3, 10,3);
  1102.       g.drawLine(11,4, 11,4);
  1103.       g.drawLine(12,5, 12,5);
  1104.       g.drawLine(13,6, 13,6);
  1105.       g.drawLine(14,7, 14,7);
  1106.       // bottom arrow
  1107.       g.drawLine(10,9,  10,9);
  1108.       g.drawLine(11,10, 11,10);
  1109.       g.drawLine(12,11, 12,11);
  1110.       g.drawLine(13,12, 13,12);
  1111.       g.drawLine(14,13, 14,13);
  1112.  
  1113.       // All Horizontal lines in DarkAccent3 (Darkish Purple)
  1114.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  1115.       g.drawLine(4,2,  15,2);  // top
  1116.       g.drawLine(4,8,  15,8);  // middle
  1117.       g.drawLine(4,14, 15,14); // bottom
  1118.  
  1119.       g.translate(-x,-y);
  1120.     }
  1121.     public int getIconWidth() { return 19; }
  1122.     public int getIconHeight() { return 17; }
  1123.   };
  1124.  
  1125.  
  1126.   // Draw the icon for the "details view" in the file chooser
  1127.   private static class FileChooserDetailsViewIcon implements Icon, UIResource, Serializable {
  1128.     public void paintIcon(Component c, Graphics g, int x, int y) {
  1129.       g.translate(x,y);
  1130.  
  1131.       // Fill document area with LightAccent1 (ooooh yummy, Cream filling)
  1132.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  1133.       g.fillRect(0,2, 11,11); // top part of document
  1134.       g.fillRect(5,13, 6, 3); // bottom part of document
  1135.  
  1136.       // Draw everything in DarkAccent3
  1137.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  1138.       g.drawLine(0,2, 9, 2); // edge highlight on the document's top
  1139.       g.drawLine(0,3, 0,12); // edge highlight on the document's left
  1140.  
  1141.       // Draw DarkAccent4 highlights
  1142.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  1143.       g.drawLine(10,2, 10,2); // top right corner highlight
  1144.       g.drawLine(4,11, 4,13); // line in document - partially overwritten by black
  1145.       g.drawLine(5,14, 5,15); // line in document
  1146.  
  1147.       // Draw everything in Black
  1148.       g.setColor(OrganicLookAndFeel.getBlack());
  1149.       // document black
  1150.       g.drawLine(10,3, 10,15); // edge highlight on the document's right
  1151.       g.drawLine(6,15,  9,15); // edge highlight on the document's bottom
  1152.       g.drawLine(6,14,  6,14); // random document dot
  1153.       g.drawLine(5,13,  5,13); // random document dot
  1154.       g.drawLine(4,12,  3,12); // random document dot
  1155.       g.drawLine(1,13,  2,13); // random document dot
  1156.       g.drawLine(3,14,  4,14); // random document dot
  1157.       // details black
  1158.       g.drawLine(12,4, 12,4); // top row
  1159.       g.drawLine(14,4, 14,4);
  1160.       g.drawLine(16,4, 16,4);
  1161.       g.drawLine(18,4, 18,4);
  1162.       g.drawLine(12,7, 12,7); // second row
  1163.       g.drawLine(14,7, 14,7);
  1164.       g.drawLine(16,7, 16,7);
  1165.       g.drawLine(12,10, 12,10); // third row
  1166.       g.drawLine(14,10, 14,10);
  1167.       g.drawLine(16,10, 16,10);
  1168.       g.drawLine(12,13, 12,13); // bottom row
  1169.       g.drawLine(14,13, 14,13);
  1170.       g.drawLine(16,13, 16,13);
  1171.       g.drawLine(18,13, 18,13);
  1172.  
  1173.       // All the little DarkAccent1 dots in document
  1174.       //  working left -> right and top -> bottom
  1175.       g.setColor(OrganicLookAndFeel.getDarkAccent1());
  1176.       g.drawLine(1,8, 1,8);
  1177.       g.drawLine(2,9, 2,9);
  1178.       g.drawLine(4,9, 4,9);
  1179.       g.drawLine(1,10, 1,10);
  1180.       g.drawLine(3,10, 3,10);
  1181.       g.drawLine(5,10, 5,10);
  1182.       g.drawLine(7,10, 7,10);
  1183.       g.drawLine(9,10, 9,10);
  1184.       g.drawLine(2,11, 2,11);
  1185.       g.drawLine(6,11, 6,11);
  1186.       g.drawLine(8,11, 8,11);
  1187.       g.drawLine(1,12, 2,12);
  1188.       g.drawLine(5,12, 5,12);
  1189.       g.drawLine(7,12, 7,12);
  1190.       g.drawLine(9,12, 9,12);
  1191.       g.drawLine(3,13, 3,13);
  1192.       g.drawLine(6,13, 6,13);
  1193.       g.drawLine(8,13, 8,13);
  1194.       g.drawLine(7,14, 7,14);
  1195.       g.drawLine(9,14, 9,14);
  1196.  
  1197.       g.translate(-x,-y);
  1198.     }
  1199.     public int getIconWidth() { return 19; }
  1200.     public int getIconHeight() { return 17; }
  1201.   };
  1202.  
  1203.  
  1204.   // Draw the icon for the "list view" in the file chooser
  1205.   private static class FileChooserListViewIcon implements Icon, UIResource, Serializable {
  1206.     public void paintIcon(Component c, Graphics g, int x, int y) {
  1207.       g.translate(x,y);
  1208.  
  1209.       // Fill body area of folders with LightAccent1
  1210.       g.setColor(OrganicLookAndFeel.getLightAccent1());
  1211.       g.fillRect(1,2,   3,4); // top left folder
  1212.       g.fillRect(11,2,  3,4); // top right folder
  1213.       g.fillRect(1,10,  3,4); // bottom left folder
  1214.       g.fillRect(11,10, 3,4); // bottom right folder
  1215.  
  1216.       // Draw top/left/bottomish edges in DarkAccent3 (Darkish Purple)
  1217.       g.setColor(OrganicLookAndFeel.getDarkAccent3());
  1218.       // top left document
  1219.       g.drawLine(0,1, 3,1); // top
  1220.       g.drawLine(0,2, 0,6); // left
  1221.       g.drawLine(1,6, 2,6); // bottomish
  1222.       g.drawLine(2,7, 2,7); // bottomish
  1223.       // top right document
  1224.       g.drawLine(10,1, 13,1); // top
  1225.       g.drawLine(10,2, 10,6); // left
  1226.       g.drawLine(11,6, 12,6); // bottomish
  1227.       g.drawLine(12,7, 12,7); // bottomish
  1228.       // bottom left document
  1229.       g.drawLine(0,9, 3,9); // top
  1230.       g.drawLine(0,10, 0,14); // left
  1231.       g.drawLine(1,14, 2,14); // bottomish
  1232.       g.drawLine(2,15, 2,15); // bottomish
  1233.       // bottom right document
  1234.       g.drawLine(10,9,  13,9); // top
  1235.       g.drawLine(10,10, 10,14); // left
  1236.       g.drawLine(11,14, 12,14); // bottomish
  1237.       g.drawLine(12,15, 12,15); // bottomish
  1238.  
  1239.       // Draw the four DarkAccent4 dots - upper right of each document
  1240.       g.setColor(OrganicLookAndFeel.getDarkAccent4());
  1241.       g.drawLine( 4,1,  4,1); // top left document
  1242.       g.drawLine(14,1, 14,1); // top right document
  1243.       g.drawLine( 4,9,  4,9); // bottom left document
  1244.       g.drawLine(14,9, 14,9); // bottom right document
  1245.  
  1246.       // Draw the Black right/bottomish highlights for each document
  1247.       g.setColor(OrganicLookAndFeel.getBlack());
  1248.       g.drawLine( 4,2,  4,7); // top left document right edge
  1249.       g.drawLine( 3,7,  3,7); // top left document bottom dot
  1250.       g.drawLine(14,2, 14,7); // top right document right edge
  1251.       g.drawLine(13,7, 13,7); // top right document bottom dot
  1252.       g.drawLine( 4,10,  4,15); // bottom left document right edge
  1253.       g.drawLine( 3,15,  3,15); // bottom left document bottom dot
  1254.       g.drawLine(14,10, 14,15); // bottom right document right edge
  1255.       g.drawLine(13,15, 13,15); // bottom right document bottom dot
  1256.       // Draw the Black info line for each document
  1257.       g.drawLine( 6, 3,   8,3); // top left document
  1258.       g.drawLine(16, 3,  18,3); // top right document
  1259.       g.drawLine( 6,11,  8,11); // bottom left document
  1260.       g.drawLine(16,11, 18,11); // bottom right document
  1261.  
  1262.       // Draw the inner document DarkAccent1 dots/highlights
  1263.       g.setColor(OrganicLookAndFeel.getDarkAccent1());
  1264.       g.drawLine( 2,5,  2,5); // top left document
  1265.       g.drawLine( 3,6,  3,6);
  1266.       g.drawLine(12,5, 12,5); // top right document
  1267.       g.drawLine(13,6, 13,6);
  1268.       g.drawLine( 2,13,  2,13); // bottom left document
  1269.       g.drawLine( 3,14,  3,14);
  1270.       g.drawLine(12,13, 12,13); // bottom right document
  1271.       g.drawLine(13,14, 13,14);
  1272.  
  1273.       // Draw single Control3 highlight at bottom of document
  1274.       g.setColor(OrganicLookAndFeel.getControl3());
  1275.       g.drawLine( 1,7,  1,7); // top left document
  1276.       g.drawLine(11,7, 11,7); // top right document
  1277.       g.drawLine( 1,15,  1,15); // bottom left document
  1278.       g.drawLine(11,15, 11,15); // bottom right document
  1279.  
  1280.       g.translate(-x,-y);
  1281.     }
  1282.     public int getIconWidth() { return 19; }
  1283.     public int getIconHeight() { return 17; }
  1284.   };
  1285.  
  1286. }
  1287.  
  1288.